﻿using System.Drawing;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;

namespace WorkflowLibrary
{
    /// <summary>
    /// Klasa designera dla aktywności wyświetlającej liste
    /// </summary>
    class ShowListActivityDesigner : ActivityDesigner
    {

        protected override void Initialize(Activity activity)
        {
            base.Initialize(activity);
        }

        protected override Size OnLayoutSize(ActivityDesignerLayoutEventArgs e)
        {
            return new Size(320, 50);
        }

        protected override void OnPaint(ActivityDesignerPaintEventArgs e)
        {
            e.Graphics.FillRectangle(Brushes.CornflowerBlue,
            Location.X, Location.Y,
            Size.Width, Size.Height);
            StringFormat format = new StringFormat();

            format.Alignment = StringAlignment.Center;
            Rectangle rect = new Rectangle(Location.X, Location.Y,
            Size.Width, 15);
            e.Graphics.DrawString((Activity as IActivityName).ActivityName,
            DesignerTheme.Font,
            Brushes.Yellow, rect, format);

        }
    }
}
